package Feb_14.TestProduct;

public class Productor implements Runnable{
    Clerk clerk;
    public Productor(Clerk clerk){
        this.clerk=clerk;
    }

    @Override
    public void run() {
        System.out.println("开始生产商品");
        while (true){
            try {
                Thread.sleep((int)Math.random()*2000);
            }catch (InterruptedException e){
                e.printStackTrace();
            }
            clerk.addProduct();
        }
    }
}
